﻿package AS3Util 
{
	import flash.display.Sprite;
	import flash.events.MouseEvent;
	import flash.text.TextField;
	import flash.text.TextFormat;
	import flash.text.TextFormatAlign;
	/**
	 * ...
	 * @author SoftExpert
	 */
	public class Trace extends Sprite
	{
		private var tx:TextField;
		
		public function Trace():void {
			tx = new TextField();
			this.addEventListener(MouseEvent.MOUSE_DOWN, _startMove, false, 0, true);
			this.addEventListener(MouseEvent.MOUSE_UP, _stopMove, false, 0, true);
			addChild(tx);
			this.tx.autoSize = TextFormatAlign.LEFT;
			var format:TextFormat = new TextFormat;
			format.font = "arial,sans-serif";
			this.tx.defaultTextFormat = format;
			this.tx.setTextFormat(format);
			//this.mouseChildren = false;
		}
		
		public function out(v:String = ""):void {
			tx.appendText("\n" + v);
			trace(v);
			
			
		}
		
		private function _startMove(ev:MouseEvent):void{
			startDrag();
		}
		
		
		private function _stopMove(e:MouseEvent):void{
			stopDrag();
		}
		
		
	}

}